<script setup>
import Son1Com from '@/components/Son1Com.vue';
import Son2Com from '@/components/Son2Com.vue';
import { useCounterStore } from '@/store/counter.js';
import { useChannelStore } from '@/store/channel.js';
import { storeToRefs } from 'pinia';
const counterStore = useCounterStore();
// const {count, msg} = storeToRefs(counterStore);
const channelStore = useChannelStore();
console.log(counterStore);



</script>

<template>
    <div>
        根组件 
        - {{ counterStore.count }} 
        - {{ counterStore.msg }}
    </div>
    <Son1Com/>
    <Son2Com/>

    <hr>

    <button @click="channelStore.getList">获取频道</button>
    <ul>
      <li v-for="item in channelStore.channelList" :key="item.id">{{ item.name }}</li>
    </ul>
</template>